home *** CD-ROM | disk | FTP | other *** search
/ Champak 50 / Volume 50 - JOGO DISK .iso / Games / jumpingrope.swf / scripts / frame_3 / DoAction.as < prev   
Text File  |  2007-10-01  |  2KB  |  63 lines

  1. function soundOn()
  2. {
  3.    soundon = "yes";
  4.    _root.startSound = new Sound(this);
  5.    _root.startSound.attachSound("startSoundM");
  6.    _root.hitAfterSound = new Sound(this);
  7.    _root.hitAfterSound.attachSound("hitAfterSoundM");
  8.    _root.jumpSound = new Sound(this);
  9.    _root.jumpSound.attachSound("jumpSoundM");
  10.    _root.hitSound = new Sound(this);
  11.    _root.hitSound.attachSound("hitSoundM");
  12.    _root.downSound = new Sound(this);
  13.    _root.downSound.attachSound("downSoundM");
  14.    _root.buttonSound = new Sound(this);
  15.    _root.buttonSound.attachSound("buttonSoundM");
  16.    _root.readySound = new Sound(this);
  17.    _root.readySound.attachSound("readySoundM");
  18.    _root.levelClearSound = new Sound(this);
  19.    _root.levelClearSound.attachSound("levelClearSoundM");
  20.    _root.gameOverSound = new Sound(this);
  21.    _root.gameOverSound.attachSound("gameOverSoundM");
  22.    _root.titleSound = new Sound(this);
  23.    _root.titleSound.attachSound("titleSoundM");
  24.    _root.backSound = new Sound(this);
  25.    _root.backSound.attachSound("backSoundM");
  26.    _root.backSound.setVolume(50);
  27.    if(nowF == "title")
  28.    {
  29.       _root.titleSound.start(0,999);
  30.    }
  31.    else if(nowF == "levelClear")
  32.    {
  33.       _root.levelClearSound.start(0,999);
  34.    }
  35.    else if(nowF == "main")
  36.    {
  37.       _root.backSound.start(0,999);
  38.    }
  39. }
  40. function soundOff()
  41. {
  42.    soundon = "no";
  43.    delete _root.startSound;
  44.    delete _root.hitAfterSound;
  45.    delete _root.jumpSound;
  46.    delete _root.hitSound;
  47.    delete _root.downSound;
  48.    delete _root.buttonSound;
  49.    delete _root.readySound;
  50.    delete _root.gameOverSound;
  51.    _root.backSound.stop();
  52.    delete _root.backSound;
  53.    _root.titleSound.stop();
  54.    delete _root.titleSound;
  55.    _root.levelClearSound.stop();
  56.    delete _root.levelClearSound;
  57. }
  58. nowF == "noting";
  59. trace("\n");
  60. trace("-------------------------");
  61. trace("Start : opening");
  62. _root.soundOn();
  63.